package cn.caplike.demo.repository.design.pattern.callback;

/**
 * @author LiKe
 * @date 2019-12-05 16:22
 */
public class App {

    public static void main(String[] args) {
        sync();

        async();
    }

    public static void sync() {
        People people = new People();
        Callback callback = msg -> System.out.println("打印机告诉我的消息是 ---> " + msg);

        System.out.println("需要打印的内容是 ---> " + "打印一份简历");
        people.goToPrintSyn(callback);
        System.out.println("我在等待 打印机 给我反馈");
    }

    public static void async() {
        People people = new People();
        Callback callback = msg -> System.out.println("打印机告诉我的消息是 ---> " + msg);

        System.out.println("需要打印的内容是 ---> " + "打印一份简历");
        people.goToPrintASyn(callback);
        System.out.println("我在等待 打印机 给我反馈");
    }
}
